package br.unirio.webdisco.dao.bo;

import java.util.List;

import br.unirio.webdisco.dao.conn.BasePostgresDAO;
import br.unirio.webdisco.dao.conn.DAOFactory;
import br.unirio.webdisco.entity.DNA;
import br.unirio.webdisco.entity.Usuario;
import br.unirio.webdisco.dao.bo.BaseBO;

public class DNABO extends BaseBO<DNA> {
	private static DNABO instancia;

	public static DNABO getInstance() {
		if (instancia == null)
			instancia = new DNABO();
		return instancia;
	}

	@Override
	public void incluir(DNA dna) throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		dao.incluir(dna);
	}

	@Override
	public void alterar(DNA dna) throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		dao.alterar(dna);
	}

	@Override
	public void excluir(DNA dna) throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		dao.excluir(dna);
	}

	@Override
	public Integer count() throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		return dao.count();
	}
	
	@Override
	public List<DNA> listar(Integer paginaTamanho, Integer paginaAtual) throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		return dao.listar(paginaTamanho, paginaAtual);
	}

	@Override
	public DNA consultarPorId(Integer id) throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		return dao.consultarPorId(id);
	}

	@Override
	public List<DNA> consultar(String parametros) throws Exception {
		BasePostgresDAO<DNA> dao = DAOFactory.getInstance().getDNADAO();
		return dao.consultar(parametros);
	}
}
